package main

import (
	"fmt"
	"sort"
)

// 构造一个将英文饮料名映射为法语（或者任意你的母语）的集合；先打印所有的饮料，然后打印原名和翻译后的名字。接下来按照英文名排序后再打印出来。

func main() {
	drinks := map[string]string{"water": "水", "wine": "酒", "tea": "茶", "milk": "奶"}
	// redrinks := make(map[string]string)
	keys := make([]string, 0, len(drinks))
	for key := range drinks {
		keys = append(keys, key)
		// redrinks[item] = key
	}
	fmt.Println("drinks: ", keys)
	for eng, chi := range drinks {
		fmt.Println(eng, ": ", chi)
	}
	fmt.Println("==== sorted map ====")

	sort.Strings(keys)
	for _, k := range keys {
		fmt.Println(k, ": ", drinks[k])
	}

}
